package com.vehicle.domains.vo.req.vehicle;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "新增普通车辆请求参数")
public class AddCommonVehicleReq {

    @Schema(name = "vehicleNumber", description = "车牌号（如：京A12345、沪A12345D）")
    @NotEmpty(message = "车牌号不能为空")
    @Pattern(regexp = "^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$",
            message = "车牌号格式不正确")
    private String vehicleNumber;

    @Schema(name = "expireTime", description = "过期时间（临时车辆必填，长期有效可不填）")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date expireTime;

    @Schema(name = "vehiclePhone", description = "车主联系电话")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String vehiclePhone;

    @Schema(name = "vehicleAddress", description = "车主地址或常停位置")
    private String vehicleAddress;

    @Schema(name = "ownerName", description = "车主姓名")
    private String ownerName;

    @Schema(name = "enabled", description = "启用状态（true-启用，false-禁用，默认启用）")
    private Boolean enabled = true;

    @Schema(name = "vehiclePlateColor", description = "车牌颜色（如：蓝色、黄色、新能源绿牌）")
    private String vehiclePlateColor;

    @Schema(name = "vin", description = "车辆识别代号（VIN码，17位）")
    @Pattern(regexp = "^[A-HJ-NPR-Z0-9]{17}$", message = "VIN码格式不正确（需17位字母数字组合）")
    private String vin;
}
